public class Practice {
    class Solution {
        public int findMin(int[] nums) {
            int left=0,right=nums.length-1,n=0;
            if(nums.length>1&&nums[0]>nums[1]){
                return nums[1];
            }
            while(left<right){
                int mid=left+(right-left)/2;
                if(nums[mid]>nums[n]){
                    left=mid+1;
                }else{
                    right=mid;
                }
            }
            if(nums[n]<nums[right]){
                return nums[n];
            }
            return nums[right];
        }
    }
}
